package com.entity;

import com.mybatisflex.annotation.*;

import java.io.Serializable;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 商品类型表 实体类。
 *
 * @author admin
 * @since 2024-05-30
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("b_type")
public class BType implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 索引
     */
    @Id(keyType = KeyType.Auto)
    private Integer id;

    /**
     * 类型名称
     */
    private String typeName;

    /**
     * 父id
     */
    private Integer fid;
    //商品类型表和商品表是1对多关系，加上以下代码可以实现连表查询
    @RelationOneToMany(selfField = "id", targetField = "typeId")
    private List<BGoods> bGoods;
}
